//
// Created by 28735 on 2024/11/29.
//

#ifndef CYCLEQUEUE_H
#define CYCLEQUEUE_H

#define MAXSIZE 100

/*  数组实现*/
typedef struct CycleQueueArray
{
    int front{};
    int rear{};
    int data[MAXSIZE]{};
}* CycleQueuePtrArray;

inline void add(CycleQueuePtrArray cycle_queue, int val)
{
    if ((cycle_queue->rear + 1) % MAXSIZE == cycle_queue->front)
    {
        return;
    }
    cycle_queue->rear = cycle_queue->rear + 1;
    cycle_queue->data[cycle_queue->rear] = val;
}

#endif //CYCLEQUEUE_H
